const requset = require("./src/service/requset");

async function saveDoc(repo_id, body) {
  // /repos/: repo_id / docs /: id
  return requset({
    method: "post",
    url: `/repos/${repo_id}/docs`,
    params: body
  });
}

async function deleteDocs(repo_id, id) {
  // /repos/: repo_id / docs /: id
  return requset({
    method: "delete",
    url: `/repos/${repo_id}/docs/${id}`,

  });
}

async function getdocsList(docid) {
  // /repos/: repo_id / docs /: id
  return requset({
    method: "get",
    url: `/repos/${docid}/docs`,
    params: {},
  });
}




async function main() {
  // await saveDoc('hpstream/ag2ub5', {
  //   Key: '完成任务',
  //   title: '2020-22',
  //   body: "{star:303303,end:393939}"
  // });


  // let res = await getdocsList('hpstream/ag2ub5');
  // let res = await deleteDocs('28696178', '81270044')

  // console.log(res.data.data)
}

main()